#ifndef FILELOCALCLASS_H
#define FILELOCALCLASS_H

#include <QObject>
#include <QFile>
#include <QFileInfo>
#include <QDir>
#include <QDate>
#include <QHash>
#include <QPixmap>
#include "AbstractLayer/Settings/settingparser.h"
#include "AbstractLayer/AvatarLib/avatarlib.h"
class FileLocalClass : public QObject
{
    Q_OBJECT
public:
    explicit FileLocalClass(QObject *parent = nullptr);

signals:
    //加载头像库完毕
    void s_loadAvatarDone(QHash<QString,QPixmap>);
private:

    QList<QPair<QString,QString>> list;
public slots:
    void initFileLocal(const QString& useroc);
    //开始加载头像
    void startLoadAvatar();
    //保存发送的文本到本地
    void addSendFile(QPair<QString,QString>);
    void saveFrontOne();
    bool copyFile(const QPair<QString,QString> sourceFilePath);
    void deleteFile(QString filepath);
    void setUserAvatar(QString path);
    void initSettings();
    void setValue(QString key,QString val);
    void refreshUser();
    void clearAvatar();
    void updateUserOC(QString newueseoc);
    void createNewUserAvatar();
    void moveAvatarCacheToAvatar(const QString& friendoc);
    void appendAvatar(const QString& oc,const QString& friendoc);
    void deleteAvatar(const QString& oc);
    void flushSettings();
signals:
    void s_freshUser(QString useroc);
private:

    QString useroc;
};

#endif // FILELOCALCLASS_H
